export default {
  name: "personaldata",
  
  data() {

  

    return {
        fileList: [],
      
      file: "",
      userSex: "",
      userNickname: "",
      userAge: "",
      introduce: "",
      userRealname: "",
      userIdcard: "",
    };
  },
  methods: {
    //  个人中心修改
    personal(value) {
      this.userSex = value;
      console.log(this.userSex);
    },

    personals() {
      const tokenname = JSON.parse(localStorage.getItem("key"));
      console.log(tokenname);
      this.$axios({
        method: "POST",
        url: "/api/update",
        params: {
          file: this.file,
          userSex: this.userSex,
          userNickname: this.userNickname,
          userAge: this.userAge,
          introduce: this.introduce,
          userRealname: this.userRealname,
          userIdcard: this.userIdcard,
        },
        // headers: {
        //   Authorization: tokenname.data.token,
        // },
      })
        // 成功
        .then((res) => {
          console.log(res.data);
          alert(res.data.msg);
        })
        // 失败
        .catch((err) => {
          console.error(err);
        });
    },
  },
};
